import request from '@/utils/request'
import querystring from 'querystring'

export function getcarPackages() {
  return request.get('/platform/customer/allCustomer')
}

/**
 * 项目启用停用
 * @param {*} id 
 */
export function changeCarPackageStatus(id) {
  return request.get(`/carPackage/status/${id}`)
}

/**
 * 套餐查看详情
 * @param {*} id 
 */
export function getCarPackageById(id) {
  return request.get(`/carPackage/detail/${id}`)
}
/**
 * 编辑查看详情
 * @param {*} id 
 */
export function getCarPackageFindById(id) {
  return request.get(`/carPackage/findById/${id}`)
}
/**
 * 套餐新增
 * @param {*} param 
 */
export function addCarPackage(param) {
  return request.post('/carPackage/save', param)
}

/**
 * 套餐修改
 * @param {*} param 
 */
export function editCarPackage(param) {
  return request.put('/carPackage/save', param)
}

export function deleteCarPackage(id) {
  return request.delete(`/carPackage/del/${id}`)
}

export function carPackageList(param, pageSize, pageNo) {
  const data = {
    pageNo,
    pageSize,
    param: {
      ...param
    }
  }
  return request.post('/carPackage/page', data)
}

export function startCarPackage(id) {
  return request.delete(`/carPackage/start/${id}`)
}

export function stopCarPackage(id) {
  return request.delete(`/carPackage/stop/${id}`)
}

/**
 * 设置常用常用套餐
 * @param {*} ids 
 */
export function frequently(ids) {
  return request.get(`/carPackage/frequently/${ids}`)
}



/**
 * 套餐不分页查询
 */
export function carPackageFindAll() {
  return request.delete(`/carPackage/findAll`)
}